package lnx

/*
#cgo CPPFLAGS: -fPIC -I../index
#cgo linux LDFLAGS: -fPIC -L${SRCDIR} -Wl,-rpath ${SRCDIR} -lhs_trade -lstdc++

#include "HSDataType.h"
#include "HSStruct.h"
void* tCreateApi();
void* tCreateSpi();
void* tGetVersion();
//  删除接口对象本身
void* tReleaseApi(void* api);
//              pszSafeLevel          安全级别
void* tInit(void* api, const char *pszLicFile, const char *pszSafeLevel, const char *pszPwd, const char *pszSslFile, const char *pszSslPwd);
//  API和交易柜台建立连接，连接建立成功后，主线程会等待用户操作子线程退出
void* tJoin(void* api);
//  注册订阅模式（暂未支持）
void* tRegisterSubModel(void* api, int eSubType);
//  注册前置机网络地址
void* tRegisterFront(void* api, const char *pszFrontAddress);
//  注册Fens网络地址
void* tRegisterFensServer(void* api, const char *pszFensAddress, const char *pszAccountID);
//  注册回调接口
void* tRegisterSpi(void* api, void *pSpi);
//  获取当前交易日期
void* tGetTradingDate(void* api);
//  接入认证
void* tReqAuthenticate(void* api, struct CHSReqAuthenticateField *pReqAuthenticate, int nRequestID);
//  终端信息上报接口(中继模式)
void* tReqSubmitUserSystemInfo(void* api, struct CHSReqUserSystemInfoField *pReqUserSystemInfo, int nRequestID);
// 客户登录
void* tReqUserLogin(void* api, struct CHSReqUserLoginField *pReqUserLogin, int nRequestID);
// 密码更改
void* tReqUserPasswordUpdate(void* api, struct CHSReqUserPasswordUpdateField *pReqUserPasswordUpdate, int nRequestID);
// 报单录入
void* tReqOrderInsert(void* api, struct CHSReqOrderInsertField *pReqOrderInsert, int nRequestID);
// 撤单
void* tReqOrderAction(void* api, struct CHSReqOrderActionField *pReqOrderAction, int nRequestID);
// 行权录入
void* tReqExerciseOrderInsert(void* api, struct CHSReqExerciseOrderInsertField *pReqExerciseOrderInsert, int nRequestID);
// 行权撤单
void* tReqExerciseOrderAction(void* api, struct CHSReqExerciseOrderActionField *pReqExerciseOrderAction, int nRequestID);
// 锁定录入
void* tReqLockInsert(void* api, struct CHSReqLockInsertField *pReqLockInsert, int nRequestID);
// 询价录入
void* tReqForQuoteInsert(void* api, struct CHSReqForQuoteInsertField *pReqForQuoteInsert, int nRequestID);
// 申请组合录入
void* tReqCombActionInsert(void* api, struct CHSReqCombActionInsertField *pReqCombActionInsert, int nRequestID);
// 最大报单数量获取
void* tReqQueryMaxOrderVolume(void* api, struct CHSReqQueryMaxOrderVolumeField *pReqQueryMaxOrderVolume, int nRequestID);
// 可锁定数量获取
void* tReqQryLockVolume(void* api, struct CHSReqQryLockVolumeField *pReqQryLockVolume, int nRequestID);
// 可行权数量获取
void* tReqQueryExerciseVolume(void* api, struct CHSReqQueryExerciseVolumeField *pReqQueryExerciseVolume, int nRequestID);
// 申请组合最大数量获取
void* tReqQryCombVolume(void* api, struct CHSReqQryCombVolumeField *pReqQryCombVolume, int nRequestID);
// 持仓汇总查询
void* tReqQryPosition(void* api, struct CHSReqQryPositionField *pReqQryPosition, int nRequestID);
// 资金账户查询
void* tReqQryTradingAccount(void* api, struct CHSReqQryTradingAccountField *pReqQryTradingAccount, int nRequestID);
// 报单查询
void* tReqQryOrder(void* api, struct CHSReqQryOrderField *pReqQryOrder, int nRequestID);
// 成交查询
void* tReqQryTrade(void* api, struct CHSReqQryTradeField *pReqQryTrade, int nRequestID);
// 行权查询
void* tReqQryExercise(void* api, struct CHSReqQryExerciseField *pReqQryExercise, int nRequestID);
// 锁定查询
void* tReqQryLock(void* api, struct CHSReqQryLockField *pReqQryLock, int nRequestID);
// 申请组合查询
void* tReqQryCombAction(void* api, struct CHSReqQryCombActionField *pReqQryCombAction, int nRequestID);
// 组合持仓明细查询
void* tReqQryPositionCombineDetail(void* api, struct CHSReqQryPositionCombineDetailField *pReqQryPositionCombineDetail, int nRequestID);
// 合约信息查询
void* tReqQryInstrument(void* api, struct CHSReqQryInstrumentField *pReqQryInstrument, int nRequestID);
// 备兑缺口查询
void* tReqQryCoveredShort(void* api, struct CHSReqQryCoveredShortField *pReqQryCoveredShort, int nRequestID);
// 行权指派查询
void* tReqQryExerciseAssign(void* api, struct CHSReqQryExerciseAssignField *pReqQryExerciseAssign, int nRequestID);
// 银行转账
void* tReqTransfer(void* api, struct CHSReqTransferField *pReqTransfer, int nRequestID);
// 银行转账查询
void* tReqQryTransfer(void* api, struct CHSReqQryTransferField *pReqQryTransfer, int nRequestID);
// 银行余额查询
void* tReqQueryBankBalance(void* api, struct CHSReqQueryBankBalanceField *pReqQueryBankBalance, int nRequestID);
// 银行账户查询
void* tReqQueryBankAccount(void* api, struct CHSReqQueryBankAccountField *pReqQueryBankAccount, int nRequestID);
// 多中心资金调拨
void* tReqMultiCentreFundTrans(void* api, struct CHSReqMultiCentreFundTransField *pReqMultiCentreFundTransfer, int nRequestID);
// 客户账单查询
void* tReqQueryBillContent(void* api, struct CHSReqQueryBillContentField *pReqQueryBillContent, int nRequestID);
// 客户账单确认
void* tReqBillConfirm(void* api, struct CHSReqBillConfirmField *pReqBillConfirm, int nRequestID);
// 保证金查询
void* tReqQryMargin(void* api, struct CHSReqQryMarginField *pReqQryMargin, int nRequestID);
// 手续费查询
void* tReqQryCommission(void* api, struct CHSReqQryCommissionField *pReqQryCommission, int nRequestID);
// 汇率查询
void* tReqQryExchangeRate(void* api, struct CHSReqQryExchangeRateField *pReqQryExchangeRate, int nRequestID);
// 持仓明细查询
void* tReqQryPositionDetail(void* api, struct CHSReqQryPositionDetailField *pReqQryPositionDetail, int nRequestID);
// 经纪公司配置参数查询
void* tReqQrySysConfig(void* api, struct CHSReqQrySysConfigField *pReqQrySysConfig, int nRequestID);
// 行情查询
void* tReqQryDepthMarketData(void* api, struct CHSReqQryDepthMarketDataField *pReqQryDepthMarketData, int nRequestID);
// 资金调拨
void* tReqFundTrans(void* api, struct CHSReqFundTransField *pReqFundTransfer, int nRequestID);
// 资金调拨流水查询
void* tReqQryFundTrans(void* api, struct CHSReqQryFundTransField *pReqQryFundTrans, int nRequestID);
// 客户通知查询
void* tReqQryClientNotice(void* api, struct CHSReqQryClientNoticeField *pReqQryClientNotice, int nRequestID);
// 期权标的信息查询
void* tReqQryOptUnderly(void* api, struct CHSReqQryOptUnderlyField *pReqQryOptUnderly, int nRequestID);
// 证券行情查询
void* tReqQrySecuDepthMarket(void* api, struct CHSReqQrySecuDepthMarketField *pReqQrySecuDepthMarket, int nRequestID);
// 历史报单查询
void* tReqQryHistOrder(void* api, struct CHSReqQryHistOrderField *pReqQryHistOrder, int nRequestID);
// 历史成交查询
void* tReqQryHistTrade(void* api, struct CHSReqQryHistTradeField *pReqQryHistTrade, int nRequestID);

// 回调虚类
void tSetOnFrontConnected(void*, void*);
void tFrontConnected(void* spi);
// 当客户端与交易后台通信连接异常时，该方法被调用。
void tSetOnFrontDisconnected(void*, void*);
void tFrontDisconnected(void* spi, int nResult);
// 客户认证
void tSetOnRspAuthenticate(void*, void*);
void tRspAuthenticate(void* spi, struct CHSRspAuthenticateField *pRspAuthenticate, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 终端信息上报接口(中继模式)
void tSetOnRspSubmitUserSystemInfo(void*, void*);
void tRspSubmitUserSystemInfo(void* spi, struct CHSRspUserSystemInfoField *pRspUserSystemInfo, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 客户登录
void tSetOnRspUserLogin(void*, void*);
void tRspUserLogin(void* spi, struct CHSRspUserLoginField *pRspUserLogin, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 密码更改
void tSetOnRspUserPasswordUpdate(void*, void*);
void tRspUserPasswordUpdate(void* spi, struct CHSRspUserPasswordUpdateField *pRspUserPasswordUpdate, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 报单录入
void tSetOnRspErrorOrderInsert(void*, void*);
void tRspErrorOrderInsert(void* spi, struct CHSRspOrderInsertField *pRspOrderInsert, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 撤单
void tSetOnRspOrderAction(void*, void*);
void tRspOrderAction(void* spi, struct CHSRspOrderActionField *pRspOrderAction, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 行权录入
void tSetOnRspErrorExerciseOrderInsert(void*, void*);
void tRspErrorExerciseOrderInsert(void* spi, struct CHSRspExerciseOrderInsertField *pRspExerciseOrderInsert, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 行权撤单
void tSetOnRspExerciseOrderAction(void*, void*);
void tRspExerciseOrderAction(void* spi, struct CHSRspExerciseOrderActionField *pRspExerciseOrderAction, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 锁定录入
void tSetOnRspErrorLockInsert(void*, void*);
void tRspErrorLockInsert(void* spi, struct CHSRspLockInsertField *pRspExerciseOrderAction, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 询价录入
void tSetOnRspForQuoteInsert(void*, void*);
void tRspForQuoteInsert(void* spi, struct CHSRspForQuoteInsertField *pRspForQuoteInsert, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 申请组合录入
void tSetOnRspErrorCombActionInsert(void*, void*);
void tRspErrorCombActionInsert(void* spi, struct CHSRspCombActionInsertField *pRspCombActionInsert, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 最大报单数量获取
void tSetOnRspQueryMaxOrderVolume(void*, void*);
void tRspQueryMaxOrderVolume(void* spi, struct CHSRspQueryMaxOrderVolumeField *pRspQueryMaxOrderVolume, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 可锁定数量获取
void tSetOnRspQryLockVolume(void*, void*);
void tRspQryLockVolume(void* spi, struct CHSRspQryLockVolumeField *pRspQryLockVolume, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 可行权数量获取
void tSetOnRspQueryExerciseVolume(void*, void*);
void tRspQueryExerciseVolume(void* spi, struct CHSRspQueryExerciseVolumeField *pRspQueryExerciseVolume, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 申请组合最大数量获取
void tSetOnRspQryCombVolume(void*, void*);
void tRspQryCombVolume(void* spi, struct CHSRspQryCombVolumeField *pRspQryCombVolume, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 持仓查询
void tSetOnRspQryPosition(void*, void*);
void tRspQryPosition(void* spi, struct CHSRspQryPositionField *pRspQryPosition, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 资金账户查询
void tSetOnRspQryTradingAccount(void*, void*);
void tRspQryTradingAccount(void* spi, struct CHSRspQryTradingAccountField *pRspQryTradingAccount, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 报单查询
void tSetOnRspQryOrder(void*, void*);
void tRspQryOrder(void* spi, struct CHSOrderField *pRspQryOrder, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 成交查询
void tSetOnRspQryTrade(void*, void*);
void tRspQryTrade(void* spi, struct CHSTradeField *pRspQryTrade, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 行权查询
void tSetOnRspQryExercise(void*, void*);
void tRspQryExercise(void* spi, struct CHSExerciseField *pRspQryExercise, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 锁定查询
void tSetOnRspQryLock(void*, void*);
void tRspQryLock(void* spi, struct CHSLockField *pRspQryLock, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 申请组合查询
void tSetOnRspQryCombAction(void*, void*);
void tRspQryCombAction(void* spi, struct CHSCombActionField *pRspQryCombAction, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 组合持仓明细查询
void tSetOnRspQryPositionCombineDetail(void*, void*);
void tRspQryPositionCombineDetail(void* spi, struct CHSRspQryPositionCombineDetailField *pRspQryPositionCombineDetail, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 合约信息查询
void tSetOnRspQryInstrument(void*, void*);
void tRspQryInstrument(void* spi, struct CHSRspQryInstrumentField *pRspQryInstrument, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 备兑缺口查询
void tSetOnRspQryCoveredShort(void*, void*);
void tRspQryCoveredShort(void* spi, struct CHSRspQryCoveredShortField *pRspQryCoveredShort, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 行权指派查询
void tSetOnRspQryExerciseAssign(void*, void*);
void tRspQryExerciseAssign(void* spi, struct CHSRspQryExerciseAssignField *pRspQryExerciseAssign, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 银行转账
void tSetOnRspTransfer(void*, void*);
void tRspTransfer(void* spi, struct CHSRspTransferField *pRspTransfer, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 银行转账查询
void tSetOnRspQryTransfer(void*, void*);
void tRspQryTransfer(void* spi, struct CHSRspQryTransferField *pRspQryTransfer, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 银行余额查询
void tSetOnRspQueryBankBalance(void*, void*);
void tRspQueryBankBalance(void* spi, struct CHSRspQueryBankBalanceField *pRspQueryBankBalance, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 银行账户查询
void tSetOnRspQueryBankAccount(void*, void*);
void tRspQueryBankAccount(void* spi, struct CHSRspQueryBankAccountField *pRspQueryBankAccount, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 多中心资金调拨
void tSetOnRspMultiCentreFundTrans(void*, void*);
void tRspMultiCentreFundTrans(void* spi, struct CHSRspMultiCentreFundTransField *pRspMultiCentreFundTransfer, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 客户账单查询
void tSetOnRspQueryBillContent(void*, void*);
void tRspQueryBillContent(void* spi, struct CHSRspQueryBillContentField *pRspQueryBillContent, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 客户账单确认
void tSetOnRspBillConfirm(void*, void*);
void tRspBillConfirm(void* spi, struct CHSRspBillConfirmField *pRspBillConfirm, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 保证金查询
void tSetOnRspQryMargin(void*, void*);
void tRspQryMargin(void* spi, struct CHSRspQryMarginField *pRspQryMargin, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 手续费查询
void tSetOnRspQryCommission(void*, void*);
void tRspQryCommission(void* spi, struct CHSRspQryCommissionField *pRspQryCommission, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 持仓明细查询
void tSetOnRspQryPositionDetail(void*, void*);
void tRspQryPositionDetail(void* spi, struct CHSRspQryPositionDetailField *pRspQryPositionDetail, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 汇率查询
void tSetOnRspQryExchangeRate(void*, void*);
void tRspQryExchangeRate(void* spi, struct CHSRspQryExchangeRateField *pRspQryExchangeRate, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 经纪公司配置参数查询
void tSetOnRspQrySysConfig(void*, void*);
void tRspQrySysConfig(void* spi, struct CHSRspQrySysConfigField *pRspQrySysConfig, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 行情查询
void tSetOnRspQryDepthMarketData(void*, void*);
void tRspQryDepthMarketData(void* spi, struct CHSDepthMarketDataField *pRspQryDepthMarketData, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 资金调拨
void tSetOnRspFundTrans(void*, void*);
void tRspFundTrans(void* spi, struct CHSRspFundTransField *pRspFundTransfer, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 资金调拨流水查询
void tSetOnRspQryFundTrans(void*, void*);
void tRspQryFundTrans(void* spi, struct CHSRspQryFundTransField *pRspQryFundTrans, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 查询客户通知
void tSetOnRspQryClientNotice(void*, void*);
void tRspQryClientNotice(void* spi, struct CHSClientNoticeField *pRspQryClientNotice, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 期权标的信息查询
void tSetOnRspQryOptUnderly(void*, void*);
void tRspQryOptUnderly(void* spi, struct CHSRspQryOptUnderlyField *pRspQryOptUnderly, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 证券行情查询
void tSetOnRspQrySecuDepthMarket(void*, void*);
void tRspQrySecuDepthMarket(void* spi, struct CHSRspQrySecuDepthMarketField *pRspQrySecuDepthMarket, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 历史报单查询
void tSetOnRspQryHistOrder(void*, void*);
void tRspQryHistOrder(void* spi, struct CHSOrderField *pRspQryHistOrder, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
// 历史成交查询
void tSetOnRspQryHistTrade(void*, void*);
void tRspQryHistTrade(void* spi, struct CHSTradeField *pRspQryHistTrade, struct CHSRspInfoField *pRspInfo, int nRequestID, _Bool bIsLast);
//  主推-成交回报
void tSetOnRtnTrade(void*, void*);
void tRtnTrade(void* spi, struct CHSTradeField *pRtnTrade);
//  主推-报单回报
void tSetOnRtnOrder(void*, void*);
void tRtnOrder(void* spi, struct CHSOrderField *pRtnOrder);
//  主推-行权
void tSetOnRtnExercise(void*, void*);
void tRtnExercise(void* spi, struct CHSExerciseField *pRtnExercise);
//  主推-申请组合
void tSetOnRtnCombAction(void*, void*);
void tRtnCombAction(void* spi, struct CHSCombActionField *pRtnCombAction);
//  主推-锁定
void tSetOnRtnLock(void*, void*);
void tRtnLock(void* spi, struct CHSLockField *pRtnLock);
//  主推-撤单错误回报
void tSetOnErrRtnOrderAction(void*, void*);
void tErrRtnOrderAction(void* spi, struct CHSOrderActionField *pRtnOrder);
//  主推-客户通知
void tSetOnRtnClientNotice(void*, void*);
void tRtnClientNotice(void* spi, struct CHSClientNoticeField *pRtnClientNotice);

#include <stdlib.h>
#include <stdint.h>
*/
import "C"

import (
	"unsafe"

	"gitee.com/haifengat/gohs/def"
)

var t *Trade

// Trade 交易接口
type Trade struct {
	//gohs.HFTrade
	spi, api unsafe.Pointer
	passWord string // 密码

	// 回调虚类
	OnFrontConnected func()
	// 当客户端与交易后台通信连接异常时，该方法被调用。
	OnFrontDisconnected func(nResult int)
	// 客户认证
	OnRspAuthenticate func(pRspAuthenticate *def.CHSRspAuthenticateField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 终端信息上报接口(中继模式)
	OnRspSubmitUserSystemInfo func(pRspUserSystemInfo *def.CHSRspUserSystemInfoField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 客户登录
	OnRspUserLogin func(pRspUserLogin *def.CHSRspUserLoginField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 密码更改
	OnRspUserPasswordUpdate func(pRspUserPasswordUpdate *def.CHSRspUserPasswordUpdateField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 报单录入
	OnRspErrorOrderInsert func(pRspOrderInsert *def.CHSRspOrderInsertField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 撤单
	OnRspOrderAction func(pRspOrderAction *def.CHSRspOrderActionField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 行权录入
	OnRspErrorExerciseOrderInsert func(pRspExerciseOrderInsert *def.CHSRspExerciseOrderInsertField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 行权撤单
	OnRspExerciseOrderAction func(pRspExerciseOrderAction *def.CHSRspExerciseOrderActionField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 锁定录入
	OnRspErrorLockInsert func(pRspExerciseOrderAction *def.CHSRspLockInsertField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 询价录入
	OnRspForQuoteInsert func(pRspForQuoteInsert *def.CHSRspForQuoteInsertField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 申请组合录入
	OnRspErrorCombActionInsert func(pRspCombActionInsert *def.CHSRspCombActionInsertField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 最大报单数量获取
	OnRspQueryMaxOrderVolume func(pRspQueryMaxOrderVolume *def.CHSRspQueryMaxOrderVolumeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 可锁定数量获取
	OnRspQryLockVolume func(pRspQryLockVolume *def.CHSRspQryLockVolumeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 可行权数量获取
	OnRspQueryExerciseVolume func(pRspQueryExerciseVolume *def.CHSRspQueryExerciseVolumeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 申请组合最大数量获取
	OnRspQryCombVolume func(pRspQryCombVolume *def.CHSRspQryCombVolumeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 持仓查询
	OnRspQryPosition func(pRspQryPosition *def.CHSRspQryPositionField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 资金账户查询
	OnRspQryTradingAccount func(pRspQryTradingAccount *def.CHSRspQryTradingAccountField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 报单查询
	OnRspQryOrder func(pRspQryOrder *def.CHSOrderField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 成交查询
	OnRspQryTrade func(pRspQryTrade *def.CHSTradeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 行权查询
	OnRspQryExercise func(pRspQryExercise *def.CHSExerciseField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 锁定查询
	OnRspQryLock func(pRspQryLock *def.CHSLockField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 申请组合查询
	OnRspQryCombAction func(pRspQryCombAction *def.CHSCombActionField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 组合持仓明细查询
	OnRspQryPositionCombineDetail func(pRspQryPositionCombineDetail *def.CHSRspQryPositionCombineDetailField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 合约信息查询
	OnRspQryInstrument func(pRspQryInstrument *def.CHSRspQryInstrumentField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 备兑缺口查询
	OnRspQryCoveredShort func(pRspQryCoveredShort *def.CHSRspQryCoveredShortField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 行权指派查询
	OnRspQryExerciseAssign func(pRspQryExerciseAssign *def.CHSRspQryExerciseAssignField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 银行转账
	OnRspTransfer func(pRspTransfer *def.CHSRspTransferField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 银行转账查询
	OnRspQryTransfer func(pRspQryTransfer *def.CHSRspQryTransferField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 银行余额查询
	OnRspQueryBankBalance func(pRspQueryBankBalance *def.CHSRspQueryBankBalanceField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 银行账户查询
	OnRspQueryBankAccount func(pRspQueryBankAccount *def.CHSRspQueryBankAccountField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 多中心资金调拨
	OnRspMultiCentreFundTrans func(pRspMultiCentreFundTransfer *def.CHSRspMultiCentreFundTransField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 客户账单查询
	OnRspQueryBillContent func(pRspQueryBillContent *def.CHSRspQueryBillContentField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 客户账单确认
	OnRspBillConfirm func(pRspBillConfirm *def.CHSRspBillConfirmField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 保证金查询
	OnRspQryMargin func(pRspQryMargin *def.CHSRspQryMarginField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 手续费查询
	OnRspQryCommission func(pRspQryCommission *def.CHSRspQryCommissionField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 持仓明细查询
	OnRspQryPositionDetail func(pRspQryPositionDetail *def.CHSRspQryPositionDetailField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 汇率查询
	OnRspQryExchangeRate func(pRspQryExchangeRate *def.CHSRspQryExchangeRateField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 经纪公司配置参数查询
	OnRspQrySysConfig func(pRspQrySysConfig *def.CHSRspQrySysConfigField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 行情查询
	OnRspQryDepthMarketData func(pRspQryDepthMarketData *def.CHSDepthMarketDataField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 资金调拨
	OnRspFundTrans func(pRspFundTransfer *def.CHSRspFundTransField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 资金调拨流水查询
	OnRspQryFundTrans func(pRspQryFundTrans *def.CHSRspQryFundTransField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 查询客户通知
	OnRspQryClientNotice func(pRspQryClientNotice *def.CHSClientNoticeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 期权标的信息查询
	OnRspQryOptUnderly func(pRspQryOptUnderly *def.CHSRspQryOptUnderlyField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 证券行情查询
	OnRspQrySecuDepthMarket func(pRspQrySecuDepthMarket *def.CHSRspQrySecuDepthMarketField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 历史报单查询
	OnRspQryHistOrder func(pRspQryHistOrder *def.CHSOrderField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	// 历史成交查询
	OnRspQryHistTrade func(pRspQryHistTrade *def.CHSTradeField, pRspInfo *def.CHSRspInfoField, nRequestID int, bIsLast bool)
	//  主推-成交回报
	OnRtnTrade func(pRtnTrade *def.CHSTradeField)
	//  主推-报单回报
	OnRtnOrder func(pRtnOrder *def.CHSOrderField)
	//  主推-行权
	OnRtnExercise func(pRtnExercise *def.CHSExerciseField)
	//  主推-申请组合
	OnRtnCombAction func(pRtnCombAction *def.CHSCombActionField)
	//  主推-锁定
	OnRtnLock func(pRtnLock *def.CHSLockField)
	//  主推-撤单错误回报
	OnErrRtnOrderAction func(pRtnOrder *def.CHSOrderActionField)
	//  主推-客户通知
	OnRtnClientNotice func(pRtnClientNotice *def.CHSClientNoticeField)
}

// NewTrade 实例化
func NewTrade() *Trade {
	t = new(Trade)

	t.api = C.tCreateApi()
	t.spi = C.tCreateSpi()
	C.tRegisterSpi(t.api, t.spi)

	C.tSetOnFrontConnected(t.spi, C.tFrontConnected)
	C.tSetOnFrontDisconnected(t.spi, C.tFrontDisconnected)
	C.tSetOnRspAuthenticate(t.spi, C.tRspAuthenticate)
	C.tSetOnRspSubmitUserSystemInfo(t.spi, C.tRspSubmitUserSystemInfo)
	C.tSetOnRspUserLogin(t.spi, C.tRspUserLogin)
	C.tSetOnRspUserPasswordUpdate(t.spi, C.tRspUserPasswordUpdate)
	C.tSetOnRspErrorOrderInsert(t.spi, C.tRspErrorOrderInsert)
	C.tSetOnRspOrderAction(t.spi, C.tRspOrderAction)
	C.tSetOnRspErrorExerciseOrderInsert(t.spi, C.tRspErrorExerciseOrderInsert)
	C.tSetOnRspExerciseOrderAction(t.spi, C.tRspExerciseOrderAction)
	C.tSetOnRspErrorLockInsert(t.spi, C.tRspErrorLockInsert)
	C.tSetOnRspForQuoteInsert(t.spi, C.tRspForQuoteInsert)
	C.tSetOnRspErrorCombActionInsert(t.spi, C.tRspErrorCombActionInsert)
	C.tSetOnRspQueryMaxOrderVolume(t.spi, C.tRspQueryMaxOrderVolume)
	C.tSetOnRspQryLockVolume(t.spi, C.tRspQryLockVolume)
	C.tSetOnRspQueryExerciseVolume(t.spi, C.tRspQueryExerciseVolume)
	C.tSetOnRspQryCombVolume(t.spi, C.tRspQryCombVolume)
	C.tSetOnRspQryPosition(t.spi, C.tRspQryPosition)
	C.tSetOnRspQryTradingAccount(t.spi, C.tRspQryTradingAccount)
	C.tSetOnRspQryOrder(t.spi, C.tRspQryOrder)
	C.tSetOnRspQryTrade(t.spi, C.tRspQryTrade)
	C.tSetOnRspQryExercise(t.spi, C.tRspQryExercise)
	C.tSetOnRspQryLock(t.spi, C.tRspQryLock)
	C.tSetOnRspQryCombAction(t.spi, C.tRspQryCombAction)
	C.tSetOnRspQryPositionCombineDetail(t.spi, C.tRspQryPositionCombineDetail)
	C.tSetOnRspQryInstrument(t.spi, C.tRspQryInstrument)
	C.tSetOnRspQryCoveredShort(t.spi, C.tRspQryCoveredShort)
	C.tSetOnRspQryExerciseAssign(t.spi, C.tRspQryExerciseAssign)
	C.tSetOnRspTransfer(t.spi, C.tRspTransfer)
	C.tSetOnRspQryTransfer(t.spi, C.tRspQryTransfer)
	C.tSetOnRspQueryBankBalance(t.spi, C.tRspQueryBankBalance)
	C.tSetOnRspQueryBankAccount(t.spi, C.tRspQueryBankAccount)
	C.tSetOnRspMultiCentreFundTrans(t.spi, C.tRspMultiCentreFundTrans)
	C.tSetOnRspQueryBillContent(t.spi, C.tRspQueryBillContent)
	C.tSetOnRspBillConfirm(t.spi, C.tRspBillConfirm)
	C.tSetOnRspQryMargin(t.spi, C.tRspQryMargin)
	C.tSetOnRspQryCommission(t.spi, C.tRspQryCommission)
	C.tSetOnRspQryPositionDetail(t.spi, C.tRspQryPositionDetail)
	C.tSetOnRspQryExchangeRate(t.spi, C.tRspQryExchangeRate)
	C.tSetOnRspQrySysConfig(t.spi, C.tRspQrySysConfig)
	C.tSetOnRspQryDepthMarketData(t.spi, C.tRspQryDepthMarketData)
	C.tSetOnRspFundTrans(t.spi, C.tRspFundTrans)
	C.tSetOnRspQryFundTrans(t.spi, C.tRspQryFundTrans)
	C.tSetOnRspQryClientNotice(t.spi, C.tRspQryClientNotice)
	C.tSetOnRspQryOptUnderly(t.spi, C.tRspQryOptUnderly)
	C.tSetOnRspQrySecuDepthMarket(t.spi, C.tRspQrySecuDepthMarket)
	C.tSetOnRspQryHistOrder(t.spi, C.tRspQryHistOrder)
	C.tSetOnRspQryHistTrade(t.spi, C.tRspQryHistTrade)
	C.tSetOnRtnTrade(t.spi, C.tRtnTrade)
	C.tSetOnRtnOrder(t.spi, C.tRtnOrder)
	C.tSetOnRtnExercise(t.spi, C.tRtnExercise)
	C.tSetOnRtnCombAction(t.spi, C.tRtnCombAction)
	C.tSetOnRtnLock(t.spi, C.tRtnLock)
	C.tSetOnErrRtnOrderAction(t.spi, C.tErrRtnOrderAction)
	C.tSetOnRtnClientNotice(t.spi, C.tRtnClientNotice)

	return t
}

//export tFrontConnected
func tFrontConnected(spi unsafe.Pointer) {
	if t.OnFrontConnected != nil {
		t.OnFrontConnected()
	}
}

//export tFrontDisconnected
func tFrontDisconnected(spi unsafe.Pointer, nResult C.int) {
	if t.OnFrontDisconnected != nil {
		t.OnFrontDisconnected(int(nResult))
	}
}

//export tRspAuthenticate
func tRspAuthenticate(spi unsafe.Pointer, pRspAuthenticate *C.struct_CHSRspAuthenticateField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspAuthenticate != nil {
		t.OnRspAuthenticate((*def.CHSRspAuthenticateField)(unsafe.Pointer(pRspAuthenticate)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspSubmitUserSystemInfo
func tRspSubmitUserSystemInfo(spi unsafe.Pointer, pRspUserSystemInfo *C.struct_CHSRspUserSystemInfoField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspSubmitUserSystemInfo != nil {
		t.OnRspSubmitUserSystemInfo((*def.CHSRspUserSystemInfoField)(unsafe.Pointer(pRspUserSystemInfo)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspUserLogin
func tRspUserLogin(spi unsafe.Pointer, pRspUserLogin *C.struct_CHSRspUserLoginField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspUserLogin != nil {
		t.OnRspUserLogin((*def.CHSRspUserLoginField)(unsafe.Pointer(pRspUserLogin)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspUserPasswordUpdate
func tRspUserPasswordUpdate(spi unsafe.Pointer, pRspUserPasswordUpdate *C.struct_CHSRspUserPasswordUpdateField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspUserPasswordUpdate != nil {
		t.OnRspUserPasswordUpdate((*def.CHSRspUserPasswordUpdateField)(unsafe.Pointer(pRspUserPasswordUpdate)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspErrorOrderInsert
func tRspErrorOrderInsert(spi unsafe.Pointer, pRspOrderInsert *C.struct_CHSRspOrderInsertField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspErrorOrderInsert != nil {
		t.OnRspErrorOrderInsert((*def.CHSRspOrderInsertField)(unsafe.Pointer(pRspOrderInsert)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspOrderAction
func tRspOrderAction(spi unsafe.Pointer, pRspOrderAction *C.struct_CHSRspOrderActionField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspOrderAction != nil {
		t.OnRspOrderAction((*def.CHSRspOrderActionField)(unsafe.Pointer(pRspOrderAction)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspErrorExerciseOrderInsert
func tRspErrorExerciseOrderInsert(spi unsafe.Pointer, pRspExerciseOrderInsert *C.struct_CHSRspExerciseOrderInsertField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspErrorExerciseOrderInsert != nil {
		t.OnRspErrorExerciseOrderInsert((*def.CHSRspExerciseOrderInsertField)(unsafe.Pointer(pRspExerciseOrderInsert)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspExerciseOrderAction
func tRspExerciseOrderAction(spi unsafe.Pointer, pRspExerciseOrderAction *C.struct_CHSRspExerciseOrderActionField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspExerciseOrderAction != nil {
		t.OnRspExerciseOrderAction((*def.CHSRspExerciseOrderActionField)(unsafe.Pointer(pRspExerciseOrderAction)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspErrorLockInsert
func tRspErrorLockInsert(spi unsafe.Pointer, pRspExerciseOrderAction *C.struct_CHSRspLockInsertField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspErrorLockInsert != nil {
		t.OnRspErrorLockInsert((*def.CHSRspLockInsertField)(unsafe.Pointer(pRspExerciseOrderAction)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspForQuoteInsert
func tRspForQuoteInsert(spi unsafe.Pointer, pRspForQuoteInsert *C.struct_CHSRspForQuoteInsertField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspForQuoteInsert != nil {
		t.OnRspForQuoteInsert((*def.CHSRspForQuoteInsertField)(unsafe.Pointer(pRspForQuoteInsert)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspErrorCombActionInsert
func tRspErrorCombActionInsert(spi unsafe.Pointer, pRspCombActionInsert *C.struct_CHSRspCombActionInsertField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspErrorCombActionInsert != nil {
		t.OnRspErrorCombActionInsert((*def.CHSRspCombActionInsertField)(unsafe.Pointer(pRspCombActionInsert)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQueryMaxOrderVolume
func tRspQueryMaxOrderVolume(spi unsafe.Pointer, pRspQueryMaxOrderVolume *C.struct_CHSRspQueryMaxOrderVolumeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQueryMaxOrderVolume != nil {
		t.OnRspQueryMaxOrderVolume((*def.CHSRspQueryMaxOrderVolumeField)(unsafe.Pointer(pRspQueryMaxOrderVolume)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryLockVolume
func tRspQryLockVolume(spi unsafe.Pointer, pRspQryLockVolume *C.struct_CHSRspQryLockVolumeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryLockVolume != nil {
		t.OnRspQryLockVolume((*def.CHSRspQryLockVolumeField)(unsafe.Pointer(pRspQryLockVolume)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQueryExerciseVolume
func tRspQueryExerciseVolume(spi unsafe.Pointer, pRspQueryExerciseVolume *C.struct_CHSRspQueryExerciseVolumeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQueryExerciseVolume != nil {
		t.OnRspQueryExerciseVolume((*def.CHSRspQueryExerciseVolumeField)(unsafe.Pointer(pRspQueryExerciseVolume)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryCombVolume
func tRspQryCombVolume(spi unsafe.Pointer, pRspQryCombVolume *C.struct_CHSRspQryCombVolumeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryCombVolume != nil {
		t.OnRspQryCombVolume((*def.CHSRspQryCombVolumeField)(unsafe.Pointer(pRspQryCombVolume)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryPosition
func tRspQryPosition(spi unsafe.Pointer, pRspQryPosition *C.struct_CHSRspQryPositionField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryPosition != nil {
		t.OnRspQryPosition((*def.CHSRspQryPositionField)(unsafe.Pointer(pRspQryPosition)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryTradingAccount
func tRspQryTradingAccount(spi unsafe.Pointer, pRspQryTradingAccount *C.struct_CHSRspQryTradingAccountField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryTradingAccount != nil {
		t.OnRspQryTradingAccount((*def.CHSRspQryTradingAccountField)(unsafe.Pointer(pRspQryTradingAccount)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryOrder
func tRspQryOrder(spi unsafe.Pointer, pRspQryOrder *C.struct_CHSOrderField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryOrder != nil {
		t.OnRspQryOrder((*def.CHSOrderField)(unsafe.Pointer(pRspQryOrder)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryTrade
func tRspQryTrade(spi unsafe.Pointer, pRspQryTrade *C.struct_CHSTradeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryTrade != nil {
		t.OnRspQryTrade((*def.CHSTradeField)(unsafe.Pointer(pRspQryTrade)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryExercise
func tRspQryExercise(spi unsafe.Pointer, pRspQryExercise *C.struct_CHSExerciseField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryExercise != nil {
		t.OnRspQryExercise((*def.CHSExerciseField)(unsafe.Pointer(pRspQryExercise)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryLock
func tRspQryLock(spi unsafe.Pointer, pRspQryLock *C.struct_CHSLockField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryLock != nil {
		t.OnRspQryLock((*def.CHSLockField)(unsafe.Pointer(pRspQryLock)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryCombAction
func tRspQryCombAction(spi unsafe.Pointer, pRspQryCombAction *C.struct_CHSCombActionField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryCombAction != nil {
		t.OnRspQryCombAction((*def.CHSCombActionField)(unsafe.Pointer(pRspQryCombAction)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryPositionCombineDetail
func tRspQryPositionCombineDetail(spi unsafe.Pointer, pRspQryPositionCombineDetail *C.struct_CHSRspQryPositionCombineDetailField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryPositionCombineDetail != nil {
		t.OnRspQryPositionCombineDetail((*def.CHSRspQryPositionCombineDetailField)(unsafe.Pointer(pRspQryPositionCombineDetail)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryInstrument
func tRspQryInstrument(spi unsafe.Pointer, pRspQryInstrument *C.struct_CHSRspQryInstrumentField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryInstrument != nil {
		t.OnRspQryInstrument((*def.CHSRspQryInstrumentField)(unsafe.Pointer(pRspQryInstrument)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryCoveredShort
func tRspQryCoveredShort(spi unsafe.Pointer, pRspQryCoveredShort *C.struct_CHSRspQryCoveredShortField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryCoveredShort != nil {
		t.OnRspQryCoveredShort((*def.CHSRspQryCoveredShortField)(unsafe.Pointer(pRspQryCoveredShort)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryExerciseAssign
func tRspQryExerciseAssign(spi unsafe.Pointer, pRspQryExerciseAssign *C.struct_CHSRspQryExerciseAssignField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryExerciseAssign != nil {
		t.OnRspQryExerciseAssign((*def.CHSRspQryExerciseAssignField)(unsafe.Pointer(pRspQryExerciseAssign)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspTransfer
func tRspTransfer(spi unsafe.Pointer, pRspTransfer *C.struct_CHSRspTransferField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspTransfer != nil {
		t.OnRspTransfer((*def.CHSRspTransferField)(unsafe.Pointer(pRspTransfer)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryTransfer
func tRspQryTransfer(spi unsafe.Pointer, pRspQryTransfer *C.struct_CHSRspQryTransferField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryTransfer != nil {
		t.OnRspQryTransfer((*def.CHSRspQryTransferField)(unsafe.Pointer(pRspQryTransfer)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQueryBankBalance
func tRspQueryBankBalance(spi unsafe.Pointer, pRspQueryBankBalance *C.struct_CHSRspQueryBankBalanceField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQueryBankBalance != nil {
		t.OnRspQueryBankBalance((*def.CHSRspQueryBankBalanceField)(unsafe.Pointer(pRspQueryBankBalance)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQueryBankAccount
func tRspQueryBankAccount(spi unsafe.Pointer, pRspQueryBankAccount *C.struct_CHSRspQueryBankAccountField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQueryBankAccount != nil {
		t.OnRspQueryBankAccount((*def.CHSRspQueryBankAccountField)(unsafe.Pointer(pRspQueryBankAccount)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspMultiCentreFundTrans
func tRspMultiCentreFundTrans(spi unsafe.Pointer, pRspMultiCentreFundTransfer *C.struct_CHSRspMultiCentreFundTransField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspMultiCentreFundTrans != nil {
		t.OnRspMultiCentreFundTrans((*def.CHSRspMultiCentreFundTransField)(unsafe.Pointer(pRspMultiCentreFundTransfer)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQueryBillContent
func tRspQueryBillContent(spi unsafe.Pointer, pRspQueryBillContent *C.struct_CHSRspQueryBillContentField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQueryBillContent != nil {
		t.OnRspQueryBillContent((*def.CHSRspQueryBillContentField)(unsafe.Pointer(pRspQueryBillContent)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspBillConfirm
func tRspBillConfirm(spi unsafe.Pointer, pRspBillConfirm *C.struct_CHSRspBillConfirmField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspBillConfirm != nil {
		t.OnRspBillConfirm((*def.CHSRspBillConfirmField)(unsafe.Pointer(pRspBillConfirm)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryMargin
func tRspQryMargin(spi unsafe.Pointer, pRspQryMargin *C.struct_CHSRspQryMarginField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryMargin != nil {
		t.OnRspQryMargin((*def.CHSRspQryMarginField)(unsafe.Pointer(pRspQryMargin)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryCommission
func tRspQryCommission(spi unsafe.Pointer, pRspQryCommission *C.struct_CHSRspQryCommissionField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryCommission != nil {
		t.OnRspQryCommission((*def.CHSRspQryCommissionField)(unsafe.Pointer(pRspQryCommission)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryPositionDetail
func tRspQryPositionDetail(spi unsafe.Pointer, pRspQryPositionDetail *C.struct_CHSRspQryPositionDetailField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryPositionDetail != nil {
		t.OnRspQryPositionDetail((*def.CHSRspQryPositionDetailField)(unsafe.Pointer(pRspQryPositionDetail)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryExchangeRate
func tRspQryExchangeRate(spi unsafe.Pointer, pRspQryExchangeRate *C.struct_CHSRspQryExchangeRateField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryExchangeRate != nil {
		t.OnRspQryExchangeRate((*def.CHSRspQryExchangeRateField)(unsafe.Pointer(pRspQryExchangeRate)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQrySysConfig
func tRspQrySysConfig(spi unsafe.Pointer, pRspQrySysConfig *C.struct_CHSRspQrySysConfigField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQrySysConfig != nil {
		t.OnRspQrySysConfig((*def.CHSRspQrySysConfigField)(unsafe.Pointer(pRspQrySysConfig)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryDepthMarketData
func tRspQryDepthMarketData(spi unsafe.Pointer, pRspQryDepthMarketData *C.struct_CHSDepthMarketDataField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryDepthMarketData != nil {
		t.OnRspQryDepthMarketData((*def.CHSDepthMarketDataField)(unsafe.Pointer(pRspQryDepthMarketData)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspFundTrans
func tRspFundTrans(spi unsafe.Pointer, pRspFundTransfer *C.struct_CHSRspFundTransField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspFundTrans != nil {
		t.OnRspFundTrans((*def.CHSRspFundTransField)(unsafe.Pointer(pRspFundTransfer)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryFundTrans
func tRspQryFundTrans(spi unsafe.Pointer, pRspQryFundTrans *C.struct_CHSRspQryFundTransField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryFundTrans != nil {
		t.OnRspQryFundTrans((*def.CHSRspQryFundTransField)(unsafe.Pointer(pRspQryFundTrans)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryClientNotice
func tRspQryClientNotice(spi unsafe.Pointer, pRspQryClientNotice *C.struct_CHSClientNoticeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryClientNotice != nil {
		t.OnRspQryClientNotice((*def.CHSClientNoticeField)(unsafe.Pointer(pRspQryClientNotice)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryOptUnderly
func tRspQryOptUnderly(spi unsafe.Pointer, pRspQryOptUnderly *C.struct_CHSRspQryOptUnderlyField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryOptUnderly != nil {
		t.OnRspQryOptUnderly((*def.CHSRspQryOptUnderlyField)(unsafe.Pointer(pRspQryOptUnderly)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQrySecuDepthMarket
func tRspQrySecuDepthMarket(spi unsafe.Pointer, pRspQrySecuDepthMarket *C.struct_CHSRspQrySecuDepthMarketField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQrySecuDepthMarket != nil {
		t.OnRspQrySecuDepthMarket((*def.CHSRspQrySecuDepthMarketField)(unsafe.Pointer(pRspQrySecuDepthMarket)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryHistOrder
func tRspQryHistOrder(spi unsafe.Pointer, pRspQryHistOrder *C.struct_CHSOrderField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryHistOrder != nil {
		t.OnRspQryHistOrder((*def.CHSOrderField)(unsafe.Pointer(pRspQryHistOrder)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRspQryHistTrade
func tRspQryHistTrade(spi unsafe.Pointer, pRspQryHistTrade *C.struct_CHSTradeField, pRspInfo *C.struct_CHSRspInfoField, nRequestID C.int, bIsLast C._Bool) {
	if t.OnRspQryHistTrade != nil {
		t.OnRspQryHistTrade((*def.CHSTradeField)(unsafe.Pointer(pRspQryHistTrade)), (*def.CHSRspInfoField)(unsafe.Pointer(pRspInfo)), int(nRequestID), bool(bIsLast))
	}
}

//export tRtnTrade
func tRtnTrade(spi unsafe.Pointer, pRtnTrade *C.struct_CHSTradeField) {
	if t.OnRtnTrade != nil {
		t.OnRtnTrade((*def.CHSTradeField)(unsafe.Pointer(pRtnTrade)))
	}
}

//export tRtnOrder
func tRtnOrder(spi unsafe.Pointer, pRtnOrder *C.struct_CHSOrderField) {
	if t.OnRtnOrder != nil {
		t.OnRtnOrder((*def.CHSOrderField)(unsafe.Pointer(pRtnOrder)))
	}
}

//export tRtnExercise
func tRtnExercise(spi unsafe.Pointer, pRtnExercise *C.struct_CHSExerciseField) {
	if t.OnRtnExercise != nil {
		t.OnRtnExercise((*def.CHSExerciseField)(unsafe.Pointer(pRtnExercise)))
	}
}

//export tRtnCombAction
func tRtnCombAction(spi unsafe.Pointer, pRtnCombAction *C.struct_CHSCombActionField) {
	if t.OnRtnCombAction != nil {
		t.OnRtnCombAction((*def.CHSCombActionField)(unsafe.Pointer(pRtnCombAction)))
	}
}

//export tRtnLock
func tRtnLock(spi unsafe.Pointer, pRtnLock *C.struct_CHSLockField) {
	if t.OnRtnLock != nil {
		t.OnRtnLock((*def.CHSLockField)(unsafe.Pointer(pRtnLock)))
	}
}

//export tErrRtnOrderAction
func tErrRtnOrderAction(spi unsafe.Pointer, pRtnOrder *C.struct_CHSOrderActionField) {
	if t.OnErrRtnOrderAction != nil {
		t.OnErrRtnOrderAction((*def.CHSOrderActionField)(unsafe.Pointer(pRtnOrder)))
	}
}

//export tRtnClientNotice
func tRtnClientNotice(spi unsafe.Pointer, pRtnClientNotice *C.struct_CHSClientNoticeField) {
	if t.OnRtnClientNotice != nil {
		t.OnRtnClientNotice((*def.CHSClientNoticeField)(unsafe.Pointer(pRtnClientNotice)))
	}
}
